﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using Aliphant.UI.Windows;

namespace Aliphant.Windows.Views
{
    /// <summary>
    /// NavigationBar.xaml 的交互逻辑
    /// </summary>
    public partial class NavigationBar : UserControl
    {
        public NavigationBar()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 窗口拖动
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void UserControl_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            // 判断是否点击的是侧边栏空白区域（DockPanel）
            bool isClickOnBlankArea = (e.OriginalSource is DockPanel);

            // 通过 InputManager 主动触发命令
            if (isClickOnBlankArea)
            {
                // 直接调用这个命令就可以实现拖动啦，嘻嘻
                GlobalProperty.WindowDropMoveCommand.Execute(null, null);
            }
        }

    }
}
